local wengua = fk.CreateSkill {
  name = "mini__wengua",
  attached_skill_name = "mini__wengua&",
}

Fk:loadTranslationTable{
  ["mini__wengua"] = "问卦",
  [":mini__wengua"] = "一名角色的出牌阶段限一次，若其为你，你可选择你的一张牌；若其不为你，其可以将一张牌交给你，"..
  "然后你可以将此牌置于牌堆顶或牌堆底，你与其从另一端摸一张牌。",

  ["#mini__wengua"] = "问卦：你可以将一张牌置于牌堆顶或牌堆底，从另一端：摸一张牌，摸一张牌",

  ["$mini__wengua1"] = "阴阳相生相克，万事周而复始。",
  ["$mini__wengua2"] = "卦不能佳，可须异日。",
}

wengua:addEffect("active", {
  anim_type = "support",
  prompt = "#mini__wengua",
  card_num = 1,
  target_num = 0,
  max_phase_use_time = 1,
  interaction = UI.ComboBox {choices = {"Top", "Bottom"}},
  card_filter = function(self, player, to_select, selected)
    return #selected == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local index = 1
    local fromPlace = "bottom"
    if self.interaction.data == "Bottom" then
      index = -1
      fromPlace = "top"
    end
    room:moveCards({
      ids = effect.cards,
      from = player,
      toArea = Card.DrawPile,
      moveReason = fk.ReasonPut,
      skillName = wengua.name,
      drawPilePosition = index,
    })
    for _ = 1, 2 do
      if not player.dead then
        room:drawCards(player, 1, wengua.name, fromPlace)
      end
    end
  end,
})

return wengua
